#!/bin/bash

# -------------------------------------------------------------------------------------
# 检查是否添加Docker网络
# -------------------------------------------------------------------------------------
checkNetwork() {
  is_add=$(docker network ls | grep 'database_app' | awk '{print $1}')
  if [ -z "$is_add" ]; then
    docker network create database_app
  fi
}

# 检查.ssh目录是否存在
sshFile="/home/${USER}/.ssh"
if [ ! -e $sshFile ]
then
    mkdir $sshFile
    chmod 750 $sshFile
fi

# 检查Docker网络
checkNetwork